package onetotwenty;

import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*;

import org.junit.Test;

public class ProblemTen {
	public long answer(int end) {
		long item = 0;
		for (int i = 2; i <= end; i++) {
			if(Util.isPrimeNumber(i)) {
				item += i;
			}
		}

		return item;
	}
	
	@Test
	public void testTen() {
		assertThat(answer(10), is(17L));
	}
	
	@Test
	public void problem() {
		System.out.println(answer(2000000));
	}
}
